package com.feri.fc.controller;

import com.feri.fc.caregiver.service.MinioService;
import com.feri.fc.caregiver.service.impl.MinioServiceImpl;
import com.feri.fc.vo.R;
import io.netty.util.concurrent.DefaultThreadFactory;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.scheduling.annotation.Async;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import java.util.concurrent.*;

/**
 * 千锋Java,为你而生！
 *
 * @Author: Feri
 * @Date:2024/11/26 14:38
 * @Modified:
 */
@RestController
@RequestMapping("api/minio")
@Tag(name = "资源模块")
//@Async //开启异步
public class MinioController {
    @Resource
    private MinioService service;
//    @Resource
//    private MinioServiceImpl minioService;
    @PostMapping("upload")
    public R upload(@RequestPart MultipartFile file){
        return service.upload(file);
    }

    @GetMapping("delete")
    public R delete(String name){
        return service.deleteFile(name);
    }
}
